package my.sample.quartz;

import static org.quartz.CronScheduleBuilder.cronSchedule;
import static org.quartz.JobBuilder.newJob;
import static org.quartz.TriggerBuilder.newTrigger;

import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MisfireTest {

	/**
	 * @param args
	 * @throws SchedulerException 
	 */
	public static void main(String[] args) throws SchedulerException {

Logger log = LoggerFactory.getLogger(MyJob.class);
		
		SchedulerFactory fact = new StdSchedulerFactory();
		Scheduler scheduler = fact.getScheduler();
		System.out.println("scheduler name: " + scheduler.getSchedulerName());
		scheduler.start();
		
		// job
		JobDetail job = newJob(MyJob.class).withIdentity("myFirst", "myGroup").build();
		
		// trigger
		CronTrigger trigger = newTrigger()
				.withIdentity("myTrigger", "myGroup")
				.withSchedule(cronSchedule("0/5 * * * * ?")).build();
		
		
				
		scheduler.scheduleJob(job, trigger);
		
	}

}
